#include "tinyAES/aes.hpp"
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <stdexcept>

class TinyAESEncryptor {
private:
    std::vector<uint8_t> key;

    std::vector<uint8_t> deriveKey(const std::string& password);
    void encryptECB(AES_ctx& ctx, std::vector<uint8_t>& data);
    void decryptECB(AES_ctx& ctx, std::vector<uint8_t>& data);


public:
    TinyAESEncryptor(const std::string& password);
    std::vector<uint8_t> encrypt(const std::vector<uint8_t>& data);
    std::vector<uint8_t> decrypt(const std::vector<uint8_t>& data);
    bool encryptFile(const std::string& inputPath, const std::string& outputPath);
    bool decryptFile(const std::string& inputPath, const std::string& outputPath);
};